package demo;

import Worm.Node;

public class WormPanel {
	private int rows = 10;
	private int cols = 30;
	private Worm worm;
	public WormPanel(){
		this.worm = new Worm(); //XXXXX
	}
	
	public Worm getWorm() {
		return worm;
	}

	public void setWorm(Worm worm) {
		this.worm = worm;
	}

	public void print(){
		for(int i=0;i<rows;i++){
			for(int j=0;j<cols;j++){
				if(i==0 || i==rows-1){  //XXXXXXXX
					System.out.print("-");
				}
				else if(j==0 || j==cols-1){
					System.out.print("|");
				}
				else if(worm.contains(new Node(i,j))){
					System.out.print("#");
				}
				else{
					System.out.print(" ");
				}
			}
			System.out.println();
		}
	}
}
